﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using AvansRS.Domain;
using AvansRS.Domain.DataInterface;
using AvansRS.Web.Util;

namespace AvansRS.Web.Controllers
{
    //[AvansAuthorize]
    public class HomeController : Controller
    {
        private IEventRepository _repository;

        public HomeController(IEventRepository repository)
        {
            _repository = repository;
        }

        public ActionResult Index()
        {
            ViewData["Message"] = "Welkom!";
            Person person = SessionHelper.GetLoggedIn(User);
            Entity entity = person.Entity;

            IList<Event> events = _repository.GetEventsForEntity(entity.ID);

            return View(events);
        }

        public ActionResult About()
        {
            return View();
        }

        public ActionResult Test()
        {
        
            return View();
        }
    }
}
